Inside Macintosh: Sound

| Previous | Chapter contents | Chapter top | Section top | Next |

Sound Manager Status Records

You can use the SndManagerStatus function to get a Sound Manager status record, which gives information on the current CPU loading caused by all open channels of sound. The SMStatus data type defines a Sound Manager status record.

TYPE SMStatus =
PACKED RECORD
    smMaxCPULoad:           Integer;        {maximum load on all channels}
    smNumChannels:          Integer;        {number of allocated channels}
    smCurCPULoad:           Integer;        {current load on all channels}
END;
smMaxCPULoad
The maximum CPU load that the Sound Manager will not exceed when allocating channels. The smMaxCPULoad field is set to a default value of 100 when the system starts up.
smNumChannels
The number of sound channels that are currently allocated by all applications. This does not mean that the channels allocated are being used, only that they have been allocated and that CPU loading is being reserved for these channels.
smCurCPULoad
The CPU load that is being taken up by currently allocated channels.

Although you can use the information contained in the Sound Manager status record to determine how many channels are allocated, you should not rely on the information in the smMaxCPULoad or smCurCPULoad field. To determine whether the Sound Manager can create a new channel, simply call the SndNewChannel function, which returns an appropriate result code if it is unable to allocate a new channel.


© 1998 Apple Computer, Inc.

| Previous | Chapter contents | Chapter top | Section top | Next |